<?php
/**
 * 功能描述：	系统模型管理
 * @datetime	2022-07-10
 * @version   	v2.3.0
 * @author   	ZHL
 * @copyrigh  	2022 ZHL 版权所有
 */

class Admin_MouldModels extends Model {

    /**
     * Notes:模型列表页
     * User: ZhuHaili
     */
    function getMouldsList($status){
        if($status){
            $params['where']['status'] = $status;
        }
        $params['table'] = 'sysmould';
        $params['field'] = '*';
        $params['order'] = 'viewseq desc,id asc,createdate asc';
        return $this->conn('mysql')->select($params);
	}

    /**
     * Notes:模型详情-根据模型编码
     * User: ZhuHaili
     */
    function getMouldsInfoToCode($sysmouldCode){
        $params['table'] = 'sysmould';
        $params['field'] = 'mouldcode';
        $params['where']['mouldcode'] = $sysmouldCode;
        return $this->conn('mysql')->find($params);
    }

    /**
     * Notes:模型详情-根据ID
     * User: ZhuHaili
     */
    function getMouldsInfo($id){
        $params['table'] = 'sysmould';
        $params['field'] = '*';
        $params['where']['id'] = $id;
        return $this->conn('mysql')->find($params);
    }
}